package com.masz.seatathree.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface SeataThreeTccServiceIntf {

    @TwoPhaseBusinessAction(name = "tccTx", commitMethod = "commit", rollbackMethod = "rollback")
    void tcc(BusinessActionContext businessActionContext);

    /**
     * 必须要以 businessActionContext 作为参数
     * @param businessActionContext
     * @return
     */
    boolean commit(BusinessActionContext businessActionContext);

    boolean rollback(BusinessActionContext businessActionContext);
}
